﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YF.BLL
{
    public class BookBLL
    {
        public static bool add(YF.Model.t_book book)
        {
            var db =new  PetaPoco.Database("xb");
            db.Insert(book);
            return true;

        }
        public static List<YF.Model.t_book> list()
        {
            var db = new PetaPoco.Database("xb");
            return db.Query<YF.Model.t_book>("select * from t_book").ToList();
        }
        public static bool delete(int bookid)
        {
            var db = new PetaPoco.Database("xb");
            
            //var book = db.Single<Model.t_book>(bookid);
            return db.Delete<Model.t_book>(bookid) > 0;
            
        }
    }
}
